package com.ys.erp.entity.data.bean;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;

import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

/**
 * @author lwj
 * @date 2025/6/20
 */
    
@Data
@TableName(value = "t_zfb_api_record")
public class ZfbApiRecord {
    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField(value = "record_type")
    private String recordType;

    /**
     * 请求体
     */
    @TableField(value = "request_info")
    private String requestInfo;

    /**
     * 响应体
     */
    @TableField(value = "response_info")
    private String responseInfo;

    @TableField(value = "version")
    @Version
    private Integer version;

    @TableField(value = "create_time")
    private LocalDateTime createTime;

    @TableField(value = "update_time", update = "now()")
    private LocalDateTime updateTime;


    @AllArgsConstructor
    @Getter
    public enum Enums {
        SEPARATE_ACCOUNT,
        HUABEI_PAY
        ;
    }

    public static final Map<String, String> ENUM_MAP = new HashMap<>();

    static {
        ENUM_MAP.put(Enums.SEPARATE_ACCOUNT.name(), "转账");
        ENUM_MAP.put(Enums.HUABEI_PAY.name(), "花呗支付");
    }

    public static boolean isContainsKey(String key) {
        return ENUM_MAP.containsKey(key);
    }

}